// src/api/api.ts
import request from "@/utils/request";

/**
 * 获取部门列表
 * @param params '部门列表'
 * @returns
 */
export const getDepartmentListApi = (params: any) => {
  return request({
    url: "/api/department/list",
    method: "GET",
    params: params,
  });
};

/**
 * 删除部门
 * @param id '部门id'
 * @returns
 */
export const deleteDepartmentApi = (id: number) => {
  return request({
    url: `/api/department/delete/${id}`,
    method: "DELETE",
  });
};

/**
 * 添加部门
 * @param data '部门数据'
 * @returns
 */
export const addDepartmentApi = (data: any) => {
  return request({
    url: "/api/department/saveOrUpdate",
    method: "POST",
    data: data,
  });
};
